package com.ruoyi.chat.service.Impl;

import com.ruoyi.chat.service.ISysUserFriendsService;
import com.ruoyi.chat.domain.SysUserFriends;
import com.ruoyi.chat.mapper.SysUserFriendsMapper;
import com.ruoyi.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysUserFriendsServiceImpl implements ISysUserFriendsService {

    @Autowired
    private SysUserFriendsMapper userFriendsMapper;
    @Override
    public void insertUserFriends(Long userId, Long friendId) {
        userFriendsMapper.addFriend(userId, friendId);
    }

    @Override
    public void deleteUserFriends(Long userId, Long friendId) {
        userFriendsMapper.removeFriend(userId, friendId);
    }

    @Override
    public List<SysUser> selectFriendsByUserId(Long userId) {
        return userFriendsMapper.selectFriendsByUserId(userId);
    }

//    @Override
//    public List<Long> selectFriendsIdByUserId(Long userId) {
//        return userFriendsMapper.selectFriendsIdByUserId(userId);
//    }
}
